/*
 * @Author: 王炜皓
 * @Date: 2023-07-29 16:04:52
 * @LastEditTime: 2023-07-29 16:08:01
 * @LastEditors: 王炜皓
 * @Description: 风场线颜色类
 * @FilePath: \cesium-tool\src\views\test\extend\effect\wind\WindyColor.ts
 */

export default class WindyColor {
    color: string[];
    constructor(color?: string[]) {
      this.color = color || [
        '#293C8B',
        '#BBF49A',
        '#869C4A',
        '#369D41',
        '#287A61',
      ];
    }
    /**
     * 根据风场值赋值对应颜色
     * @param value 当前风场网格分量值
     * @returns
     */
    getWindColor(value: number) {
      if (value <= 3) return this.color[0];
      if (value <= 6) return this.color[1];
      if (value <= 9) return this.color[2];
      if (value <= 12) return this.color[3];
      return this.color[4];
    }
  }